home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 30
/
Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso
/
Aminet
/
dev
/
mui
/
MCC_TearOff.lha
/
MCC_TearOff
/
Developer
/
AutoDocs
/
MCC_TearOffPanel.doc
< prev
Wrap
Text File
|
1999-01-10
|
7KB
|
202 lines
TABLE OF CONTENTS
TearOffPanel.mcc/TearOffPanel.mcc
TearOffPanel.mcc/COMPATIBILITY
TearOffPanel.mcc/MUIA_TearOffPanel_Contents
TearOffPanel.mcc/MUIA_TearOffPanel_Horiz
TearOffPanel.mcc/MUIA_TearOffPanel_State
TearOffPanel.mcc/TearOffPanel.mcc
This class is a movable MUI group. Group can be dragged with mouse
and even torn off its parent, becoming a separate window.
This kind of user interface elements are recently very popular
in Windoze world, so I wanted to have something like that in MUI.
Panel class can work in cooperation with TearOffBay class. The Bay
allows to move the panel inside the window (see TearOffBay docs).
You can also use the Panels alone, but this is not so comfortable.
Additional windows created by the Panels get their Window_ID's from
the panel's ObjectID. Set it to non-zero if you want the window
positions to be saved.
NEW in v13:
- mcp module for configuration
- support for horizontal and vertical panels
- panels can be moved between bays
- panels have labels for easy identification
- you can show/hide any panel from the bay's context menu
- uses CompactWindow.mcc
still missing:
- localization
- something more?
TearOff classes are Polymorphware. That means, if you use it in your program,
you have to pay/send me what you expect from your users, eg. if it is
'Chocolateware' you should send me a bar of chocolate. Freeware programs
can use TearOff for free, of course.
Szymon Ulatowski, szulat@friko6.onet.pl
support site:
http://friko6.onet.pl/rz/szulat/tearoff/
TearOffPanel.mcc/COMPATIBILITY
TearOff classes use some undocumented features of MUI and muigfx.library.
This can give one of 2 effects:
- the author of MUI will come to the conclusion that developers need
those features and will officially reveal and document it (hahaha)
(can you believe that frame selection gadget and frame drawing routine
are 'secret'? in graphics user interface system?)
- there will be a new version of MUI (hahahahaha!!!!!) and TearOff will
not work with it
As you can see, both possibilities are a science fiction.
Anyway, if you are afraid of the second one, you can sleep well.
TearOff checks each time if the MUI version is 'safe' and will disable
'tricks' when it is too new (in 'notricks' mode, panels are drawn
using plain frame and no images :-( ). Of course the new TearOff
will consider the new MUI safe again.
But if you are brave, you can check if the new version is also safe.
Set the env. variable:
setenv tearoffsafemui 20 (if the new mui version is 20)
and test the tearoff panels. If they work ok, you can make the setting
permanent: copy env:tearoffmuisafe envarc:
TearOffPanel.mcc/MUIA_TearOffPanel_Bay
NAME
MUIA_TearOffPanel_Bay -- [..G], Object *
FUNCTION
You can get the parent bay for your panel here.
Not really useful for application designers.
TearOffPanel.mcc/MUIA_TearOffPanel_Contents
NAME
MUIA_TearOffPanel_Contents -- [I.G], Object *
FUNCTION
Any object, that will be inside the panel.
NOTE
If you want to create a comfortable GUI and take advantage of
TearOff features you make your panel object flexible ie. don't
define fixed sizes.
BUGS
This is TearOffBay problem, but you should know, that
placing too many wide horizontal panels (i.e. big _minwidth)
in the bay can be dangerous if the user arranged them horizontally.
The same applies to vertical panels with big _minheight.
SEE ALSO
TearOffBay.mcc/TearOffBay.mcc, MUIA_TearOffPanel_Horiz
TearOffPanel.mcc/MUIA_TearOffPanel_CanFlipShape
NAME
MUIA_TearOffPanel_CanFlipShape -- [ISG], BOOL
FUNCTION
If your panel can work in both horizontal in vertical layout,
you can enable this tag.
In that case the user will be able to drag your panel into another
bay, even if it has another layout.
Default value is FALSE, that means the panel can be used in
only one type of bays.
NOTE
You will probably want to change something in your panel
before it goes into alien-shaped bay. You can use notification
for that purpose. eg.
DoMethod(panel,MUIM_Notify,MUIA_TearOffPanel_Horiz,MUIV_EveryTime,
slider,3,MUIM_Set,MUIA_Slider_Horiz,MUIV_TriggerValue);
Unfortunately there are not many classes that can change the
layout in runtime.
According to MUI docs, only the slider objects have Horiz
attribute settable.
Experiments have proved that also the group class is able to
accept the change. (despite of MUIA_Group_Horiz [I..] in docs!)
One more object that could change the could be the text object
(and the buttons). We could do:
DoMethod(panel,MUIM_Notify,MUIA_TearOffPanel_Horiz,TRUE,
text,3,MUIM_Set,MUIA_TextContents,"Text");
DoMethod(panel,MUIM_Notify,MUIA_TearOffPanel_Horiz,FALSE,
text,3,MUIM_Set,MUIA_TextContents,"T\ne\nx\nt");
...but this is not very good, because exisiting text class
has no SetVMin attribute and long string will give very tall
and unsizable objects.
A text class with Horiz/Vert switch would be really useful!
SEE ALSO
TearOffBay.mcc/MUIA_TearOffBay_Horiz, MUIA_TearOffPanel_Horiz,
TearOffBay.mcc/MUIA_TearOffBay_LinkedBay
TearOffPanel.mcc/MUIA_TearOffPanel_Horiz
NAME
MUIA_TearOffPanel_Horiz -- [ISG], BOOL
FUNCTION
Since V13 TearOff classes suport both horizontal and vertical
layout for panels and bays.
In most cases you should not add vertical panels to the
horizontal bays (and vice versa).
SEE ALSO
TearOffBay.mcc/MUIA_TearOffBay_Horiz, MUIA_TearOffPanel_CanFlipShape
TearOffPanel.mcc/MUIA_TearOffPanel_Label
NAME
MUIA_TearOffPanel_Label -- [ISG], char*
FUNCTION
Panel's label will be displayed in the context menus, window
titlebar and as icon label for hidden panels.
You should always use this attribute.
TearOffPanel.mcc/MUIA_TearOffPanel_WindowTags
NAME
MUIA_TearOffPanel_WindowTags -- [ISG], APTR
FUNCTION
You can specify additional tags that will be passed
to the window when your panel is switched to the 'TornOff' mode.
NOTE
Remember, the window is a CompactWindow not the usual MUI Window!
SEE ALSO
MUIA_TearOffPanel_State, CompactWindow.mcc/CompactWindow.mcc
TearOffPanel.mcc/MUIA_TearOffPanel_State
NAME
MUIA_TearOffPanel_State -- [ISG], long
FUNCTION
You can change the panel's state, but why? Let the user do it.
Maybe it is useful for notification.
SPECIAL VALUES
MUIV_TearOffPanel_State_Fixed - panel is inside the window
MUIV_TearOffPanel_State_Hidden - well...
MUIV_TearOffPanel_State_Torn - outside the window
MUIV_TearOffPanel_State_Cycle - set only, switch to the next state